package thread;

/**
 * 使用匿名内部类完成线程的两种创建
 */
public class ThreadDemo3 {
    public static void main(String[] args) {
        Runnable r1 = () -> {
            for (int i = 0; i < 10000; i++) {
                System.out.println("你哈");
            }
        };
        Thread t1 = new Thread(r1);
        t1.start();

        Thread t2 = new Thread() {
            public void run() {
                for (int i = 0; i < 10000; i++) {
                    System.out.println("我叫123214");
                }
            }
        };
        t2.start();
    }
}
